layui.define(['element', 'fast_config'], function(exports) {
	"use strict";


    function domainModelContentPanelListener(data,elem) {
        amis.render({
            elem: '#'+elem,
            json: {
                type: 'page',
                title: '表单页面',
                body: {
                    type: 'form',
                    mode: 'horizontal',
                    api: '/saveForm',
                    body: [
                        {
                            label: 'Name',
                            type: 'input-text',
                            name: 'name'
                        },
                        {
                            label: 'Email',
                            type: 'input-email',
                            name: 'email'
                        }
                    ]
                }
            }
        })
    }

	/**
	 * Button component
	 * */
	var MOD_NAME = 'listener',
		$ = layui.jquery,
        fast_config = layui.fast_config,

        //监听器
        contentPanelListeners = {
        },
        contextMenuListeners = {
        },
        toolbarListeners = {
        },
        resourceTreeClickListeners = {

        }
    ;



	var listener = {
        registerContentPanelListener : function(name, listener){
            contentPanelListeners[name] = listener;
        },
        getContentPanelListener : function(name){
            return contentPanelListeners[name];
        },
        registerContextMenuListener : function(name, listener){
            contextMenuListeners[name] = listener;
        },
        getContextMenuListener : function(name){
            return contextMenuListeners[name];
        },
        registerToolbarListener : function(name, listener){
            toolbarListeners[name] = listener;
        },
        getToolbarListener : function(name){
            return toolbarListeners[name];
        },



        //资源树点击事件监听器
        registerResourceTreeClickListener : function(name, listener){
            resourceTreeClickListeners[name] = listener;
        },
        getResourceTreeClickListener : function(name){
            return resourceTreeClickListeners[name];
        },
        getResourceTreeClickListeners : function(){
            return resourceTreeClickListeners;
        }
    }



    exports(MOD_NAME, listener);
});
